﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EzDesk.AppWebPortal.CoreClient;

namespace EzDesk.AppWebPortal.Controllers
{
    public class CoreClientServiceController : Controller
    {
        private ICoreClientService _service;

        public CoreClientServiceController(ICoreClientService coreClientService)
        {
            _service = coreClientService;
        }

        public CoreClientServiceController()
            :this(new CoreClientServiceClient())
        {
        }

        [HttpGet]
        public JsonResult GetString()
        {
            string str = "sample for server.";
            return Json(str, JsonRequestBehavior.AllowGet);
        }

        [HttpGet]
        public JsonResult GetAllUserInfo()
        {
            return Json(
                _service.GetSimpleUserInfos("everyone"), 
                JsonRequestBehavior.AllowGet
                );
        }

    }
}
